//
//  XXFilterCell.swift
//  OfferManager
//
//  Created by 谢雄 on 2018/1/7.
//  Copyright © 2018年 OFFER. All rights reserved.
//

import UIKit

class XXFilterCell: UITableViewCell {

    @IBOutlet weak var rightSelectIcon: UIImageView!
    @IBOutlet weak var sortTitle: UILabel!
    @IBOutlet weak var seletString: UILabel!

    @IBOutlet weak var rightArrow: UIImageView!
    @IBOutlet weak var titleLab: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    //MARK:-
    //MARK:Class func
    class func caculateCellHeight () -> CGFloat {
        return 44
    }
    
    class func sortCellWithTable (_ tableView :UITableView) -> UITableViewCell {
        var cell :UITableViewCell? = tableView.dequeueReusableCell(withIdentifier: "XXSortCell")
        if cell == nil {
            cell = Bundle.main.loadNibNamed("XXFilterCell", owner: nil, options: nil)?.last as? UITableViewCell
        }
        return cell!
    }
    
    class func filterCellWithTable (_ tableView :UITableView) -> UITableViewCell {
        var cell :UITableViewCell? = tableView.dequeueReusableCell(withIdentifier: "XXFilterCell")
        if cell == nil {
            cell = Bundle.main.loadNibNamed("XXFilterCell", owner: nil, options: nil)?.last as? UITableViewCell
        }
        return cell!
    }
    
    //Mark :data
    func updateCellWithData (_ title:String) {
        self.sortTitle!.text = title
        self.rightSelectIcon.image = UIImage.iconWithInfo("\u{e644}", fontSize: 14, color: nil)
    }
    
}
